<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <title>后台管理</title>
    <link href="/Public/Admin/css/bootstrap.min.css" rel="stylesheet">
    <link href="/Public/Common/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
    <link href="/Public/Admin/css/base.css" rel="stylesheet">
    <script src="/Public/Common/js/jquery-1.9.1.min.js"></script>

</head>
<body>
<link href="/Public/Admin/css/login.css" rel="stylesheet">
<div class="login-wrapper">


    <div class="container">
        <div class="row">
            <div class="col-md-4 col-md-offset-4 box">
                <div class="content-wrap">
                    <h6>后台登陆</h6>
                    <form action="<?php echo U('Manager/login');?>" method="post" class="form">
                        <div class="form-group col-lg-12" id="account-form" >
                            <div class="input-group input-group-lg col-lg-12">
                                <span class="input-group-addon"><span aria-hidden="true" class="icon glyphicon glyphicon-user"></span></span>
                                <input class="form-control" name="account" id="account" type="text" placeholder="账号">
                            </div>
                        </div>
                        <div class="form-group col-lg-12">
                            <div class="input-group input-group-lg col-lg-12">
                                <span class="input-group-addon"><span aria-hidden="true" class="icon glyphicon glyphicon-lock"></span></span>
                                <input class="form-control" name="password" type="password" placeholder="密码">
                            </div>
                        </div>
                        <div class="form-group col-lg-12" id="verifyDiv">
                            <div class="input-group input-group-lg col-lg-6" style="float:left; margin-right:10px;">
                                <span class="input-group-addon"><span aria-hidden="true" class="icon glyphicon glyphicon-random"></span></span>
                                <input class="form-control text-input" name="verify" type="text" placeholder="验证码">
                            </div>
                            <div class="fl">
                                <img src="<?php echo U('Manager/verify');?>" onclick="change_verify();" id="verify_img" width="145" height="45">
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12 login-btn">
                                <input type="hidden" name="errorNum" id="errorNum" value="0">
                                <p><button type="submit" class="btn btn-primary btn-lg btn-block submit-btn">立刻登录</button></p>
                            </div>
                        </div>
                        <div class="notification"></div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    //刷新验证码
    function change_verify(){

        var str = "<?php echo U('Manager/verify');?>";
        document.getElementById('verify_img').src=str+'/'+new Date().getTime();
    }

    //表单提交
    $('form').submit(function(){
        var _this = $(this);
        $.post(_this.attr('action'), _this.serialize(), success, 'json');
        return false;
        function success(data){
            if(data.status){
                window.location.href = data.url;
            }else{
                $('.notification').html(data.info);
                change_verify();
            }
        }
    });
</script>
</body>
</html>